package item;

import character.MyCharacter;

public abstract class WeaponFactory {

    public static Weapon getWeapon(WeaponEnum weaponEnum) {
	Weapon weapon = new Weapon();
	populateWeapon(weapon, weaponEnum);
	return weapon;
    }

    public static Weapon getWeapon(MyCharacter owner, WeaponEnum weaponEnum) {
	Weapon weapon = new Weapon(owner);
	populateWeapon(weapon, weaponEnum);
	return weapon;
    }

    protected static void populateWeapon(Weapon weapon, WeaponEnum weaponEnum) {
	weapon.setWeaponName(weaponEnum.getWeaponName());
	weapon.setWeaponType(weaponEnum.getWeaponType());
	weapon.setBaseSpeed(weaponEnum.getBaseSpeed());
	weapon.setRangePattern(weaponEnum.getRangePattern());
	weapon.setRangeSize(weaponEnum.getRangeSize());
	weapon.setBaseDamage(weaponEnum.getBaseDamage());
    }
}
